<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/6/28
 * Time: 10:47
 */
namespace common\component;
use Yii;
use yii\base\Model;

class Upload extends Model{

    //文件
    public $file;

    //文件上传规则
    public function rules(){
        return [
            [['file'], 'file', 'extensions' => 'jpg, png', 'mimeTypes' => 'image/jpeg, image/png',],
        ];
    }

    //文件标签
    public function attributeLabels(){
        return [
            'file'=>'文件上传'
        ];
    }
}